//
//  CycleType.m
//  PerfectWorld
//
//  Created by dllo on 16/9/1.
//  Copyright © 2016年 LST. All rights reserved.
//

#import "CycleType.h"
#import "Before.h"
#import "In.h"
#import "After.h"
@implementation CycleType
- (void)setValue:(id)value forKey:(NSString *)key {
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"before"]) {
        NSMutableArray<Before *> *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            Before * before = [Before modelWithDic:dic];
            [array addObject:before];
        }
        _before = array;
    }
    if ([key isEqualToString:@"in"]) {
        NSMutableArray<In *> *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            In * inArr = [In modelWithDic:dic];
            [array addObject:inArr];
        }
        _inArr = array;
    }
    if ([key isEqualToString:@"after"]) {
        NSMutableArray<After *> *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            After * after = [After modelWithDic:dic];
            [array addObject:after];
        }
        _after = array;
    }


}

@end
